<!DOCTYPE html>
<html lang="en">
<head>
    <title>ACE in Action</title>
    <style type="text/css" media="screen">
        #editor {
            position: relative !important;
            border: 1px solid lightgray;
            margin: auto;
            height: 400px;
            width: 80%;
        }
    </style>
</head>
<body>

<script src="js/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="js/theme-eclipse.js" type="text/javascript" charset="utf-8"></script>
<script src="js/mode-javascript.js" type="text/javascript" charset="utf-8"></script>

<div>
    scroll down
</div>
<pre id="editor">function foo(items) {
    var i;
    for (i = 0; i &lt; items.length; i++) {
        alert("Ace Rocks " + items[i]);
    }
}</pre>

<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/eclipse");
    editor.getSession().setMode("ace/mode/javascript");
</script>
</body>
</html>